﻿using KouDai.WinPad.Helper;
using KouDai.WinPad.Models;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;

namespace KouDai.WinPad.Controls
{
    public class ShellContainerStyleSelector : StyleSelector
    {
        public Style CategoryContainerStyle { get; set; }
        public Style CommonContainerStyle  { get; set; }

        protected override Style SelectStyleCore(object item, DependencyObject container)
        {
            if (item is ICollectionViewGroup)
            {
                GroupCollection<HoneyEntity> group = (GroupCollection<HoneyEntity>)((ICollectionViewGroup)item).Group;
                ZoomOutModel model = (ZoomOutModel)group.Key;
                if (model.GroupName.Equals("分类"))
                {
                    return CategoryContainerStyle;
                }
                else
                {
                    return CommonContainerStyle;
                }
            }
            return base.SelectStyleCore(item, container);
        }
    }
}
